<?php
use yii\helpers\Url;
use yii\Web\View;
use app\assets\NewCampaignLabelAsset;
/* @var $this yii\web\View */
NewCampaignLabelAsset::register($this); 
$this->title = $this->context->pageTitle.Yii::$app->params['titleSuffix'];
$this->params['breadcrumbs'] = [
  [
    'label' => \Yii::t('campaign-label', 'Campaign Label'),
    'url' => ['label-list']
  ],
  \Yii::t('campaign-label', 'New Label')
];
$jsMsgs = $this->context->loadJsMsgs([
  'campaignForm',
  'campaignLable'
]);
$this->registerJs("VAM.setVar('LANGUAGE_JS', '".$jsMsgs."');", View::POS_HEAD);
?>
<div class="page-header">
  <h1>
    <?=\Yii::t('campaign-label', 'Campaign Label')?>
    <small><?=\Yii::t('campaign-label', 'New Label')?></small>
  </h1>
</div>
<div class="panel panel-default">
  <div class="panel-heading">
    <i class="fa fa-plus-circle"></i>
    <?=\Yii::t('campaign-label', 'New Label')?>
    <ul class="list-unstyled pull-right">
      <li>
        <a href="#">
          <i class="fa fa-chevron-up"></i>
        </a>
      </li>
    </ul>
  </div>
	<div class="panel-body">
    <div class="step-container">
      <ul class="step-wrap">
        <li class="step-undone step-active">
          <a href="javascript:void(0);" title="<?=\Yii::t('common', 'Add Label')?>">
            <i class="fa fa-chevron-right"></i>
          </a>
          <p><?=\Yii::t('common', 'Add Label')?></p>
        </li>
        <li class="step-undone">
          <a href="javascript:void(0);" title="<?=\Yii::t('common', 'Add Campaign')?>">
            <i class="fa fa-chevron-right"></i>
          </a>
          <p><?=\Yii::t('common', 'Add Campaign')?></p>
        </li>
         <li class="step-undone">
          <a href="javascript:void(0);" title="<?=\Yii::t('common', 'Add Solution')?>">
            <i class="fa fa-chevron-right"></i>
          </a>
          <p><?=\Yii::t('common', 'Add Solution')?></p>
        </li>
         <li class="step-undone">
          <a href="javascript:void(0);" title="<?=\Yii::t('common', 'Add Creative')?>">
            <i class="fa fa-chevron-right"></i>
          </a>
          <p><?=\Yii::t('common', 'Add Creative')?></p>
        </li>
      </ul>
      <div class="step-progress-bar">
        <div class="step-progress" style="width: 0%;"></div>
      </div>
    </div>
		<div class="row">
			<div class="col-sm-8 col-sm-offset-2">
        <form action="<?php echo Url::to(['campaign-label/new-campaign-label-handle']);?>" method="post" class="form-horizontal" id="data-frm">
          <input class="hidden" type="text" name="id" value="">
          <fieldset>
            <legend><?=\Yii::t('campaign-label', 'Label Info')?></legend>
            <div class="form-group">
              <label for="campaign_label_name" class="col-sm-3 control-label">
                <em>*</em>
                <?=\Yii::t('campaign-label', 'Label Name')?>：
              </label>
              <div class="col-sm-9">
                <input type="text" class="form-control" id="campaign_label_name" name="name" value="" placeholder="<?=\Yii::t('campaign-label', 'Label Name')?>">
                <div class="help-block text-error" id="campaign_label_name_err"></div>
              </div>
            </div>
            <div class="form-group">
              <label for="campaign_label_comment" class="col-sm-3 control-label">
                <?=\Yii::t('campaign-label', 'Comment')?>：
              </label>
              <div class="col-sm-9">
                <textarea class="form-control" id="campaign_label_comment" name="description" cols="30" rows="10" style="resize:none;"></textarea>
                <div class="help-block text-error" id="campaign_label_comment_err"></div>
              </div>
            </div>
          </fieldset>
          <fieldset>
            <div class="form-group">
              <div class="col-sm-offset-2 col-sm-10 col-xs-11">
                <div class="btn-form-group pull-right">
                  <input class="operate-type" type="hidden" value="save">
                  <button type="submit" class="btn btn-primary save-btn" data-operate="save" data-loading-text="<i class='fa fa-spinner fa-spin'></i> <?=\Yii::t('common', 'Saving')?>..."><?=\Yii::t('common', 'Save')?></button>
                  <button type="submit" class="btn btn-success save-next-btn" data-operate="save-next" data-loading-text="<i class='fa fa-spinner fa-spin'></i> <?=\Yii::t('common', 'Saving')?>...">
                    <?=\Yii::t('campaign-label', 'Save and Create Campaign')?>
                    <i class="fa fa-caret-right"></i>
                  </button>
                  <a href="<?php echo Url::to(['campaign-label/label-list']); ?>" class="btn btn-default"><?=\Yii::t('common', 'Back')?></a>
                </div>
              </div>
            </div>
          </fieldset>
        </form>
      </div>
		</div>
	</div>
</div>
<?php
  $nextUrl = Url::to(['launch/add-new-launch']);
  $this->registerJs("VAM.setVar('NEXT_URL','$nextUrl');",View::POS_HEAD);
?>
<script type="text/javascript" >
  requirejs(["<?= Yii::getAlias('@web/').Yii::$app->params['envDir'];?>/js/site.js"], function(common) {
    requirejs(["<?= Yii::getAlias('@web/').Yii::$app->params['envDir'];?>/js/label/newLabel.js"]);
  });
</script>
